package com.thinkcoder.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
public class LogTest {


    @GetMapping("/test")
    public void test(){

        log.debug("debug");
        log.info("info");
        log.warn("warn");
        log.error("error");

        System.out.println(this.getClass().getClassLoader());
    }

    @GetMapping("/test1")
    public void test1(String a){
        String name = Thread.currentThread().getName();
        if(a.equals("1")){
            throw new RuntimeException("此线程执行"+name+"发生异常");
        }else{

            System.out.println("此线程执行"+name+"没有异常");
        }
    }
}
